Skip to content

chore(nextjs): Improve machine auth verification calls #6367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 23, 2025

Conversation

wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Jul 21, 2025

Description

The clerkMiddleware() runs authenticateRequest({ acceptsToken: 'any' }) under the hood so it already verifies all type of tokens, but then auth() was re-verifying machine tokens, causing duplicate API calls.

The PR eliminates the duplicate call by reusing the encrypted auth object from middleware.

Resolves USER-2379

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted handling of authentication tokens to ensure correct data is processed based on token type.
    • Fixed conditional return of authentication data to better reflect token types and redirect behavior.
    • Streamlined authentication token verification by simplifying token handling and removing asynchronous checks.
    • Improved test coverage with updated synchronous authentication tests and mock token injection.

Copy link

changeset-bot bot commented Jul 21, 2025

🦋 Changeset detected

Latest commit: cc4358b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ⬜️ Skipped (Inspect) Jul 23, 2025 7:37pm

Copy link

pkg-pr-new bot commented Jul 21, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6367

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6367

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6367

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6367

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6367

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6367

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6367

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6367

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6367

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6367

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6367

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6367

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6367

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6367

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6367

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6367

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6367

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6367

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6367

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6367

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6367

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6367

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6367

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6367

commit: cc4358b

Copy link
Contributor

coderabbitai bot commented Jul 21, 2025

📝 Walkthrough

Walkthrough

The changes update the Next.js package's server-side authentication flow by introducing a new machineAuthObject parameter passed through decorateRequest and encryption/decryption utilities. The decorateRequest call conditionally includes this object based on token type. The encryptClerkRequestData and decryptClerkRequestData functions now handle the machineAuthObject within the encrypted request data payload. Machine token handling is simplified by removing asynchronous verification calls, instead relying on decrypted request data from the x-clerk-request-data header. The main authentication functions are renamed and unified, switching from asynchronous to synchronous where applicable. The auth function conditionally attaches redirect methods only for session tokens. Tests and internal imports were updated to reflect these changes, streamlining authentication data handling in request processing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c7e51f and cc4358b.

📒 Files selected for processing (1)
  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*

⚙️ CodeRabbit Configuration File

**/*: If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

Whenever reviewing a pull request, if there are any changes that could impact security, always tag clerk/security in the PR.

Security-impacting changes include, but are not limited to:

  • Changes to authentication logic or mechanisms (e.g. login, session handling, token issuance)
  • Any modification to access control, authorization checks, or role-based permissions
  • Introduction or modification of hashing algorithms, signature verification, or cryptographic primitives
  • Handling of sensitive data (e.g. passwords, tokens, secrets, PII)
  • Integration with external identity providers (e.g. SSO, OAuth, OpenID Connect)
  • Modifications to security headers, cookie flags, CORS policies, or CSRF protections
  • Bypass mechanisms (e.g. feature flags, testing overrides) that could weaken protections
  • Changes to rate limiting, abuse prevention, or input validation

If you're unsure whether a change is security-relevant, err on the side of caution and tag clerk/security.

Any time that you tag clerk/security, please do so explicitly in a code comment, rather than within a collapsed section in a coderabbit comment, such as the "recent review details" section. If you do use the team name in any thinking or non-direct-code-comment content, it can be referred to as "clerk security team" to avoid accidentally printing the tag which sends a notification to the team.

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
🧬 Code Graph Analysis (1)
packages/nextjs/src/server/data/getAuthDataFromRequest.ts (8)
packages/nextjs/src/server/types.ts (1)
  • RequestLike (9-9)
packages/nextjs/src/server/headers-utils.ts (2)
  • getAuthKeyFromRequest (11-16)
  • getHeader (18-27)
packages/nextjs/src/server/utils.ts (1)
  • decryptClerkRequestData (225-254)
packages/nextjs/src/server/constants.ts (4)
  • SECRET_KEY (7-7)
  • PUBLISHABLE_KEY (8-8)
  • API_URL (10-10)
  • API_VERSION (6-6)
packages/backend/src/tokens/authObjects.ts (4)
  • SignedInAuthObject (44-62)
  • SignedOutAuthObject (67-83)
  • AuthObject (162-167)
  • getAuthObjectForAcceptedToken (465-495)
packages/backend/src/tokens/tokenTypes.ts (3)
  • TokenType (1-6)
  • TokenType (11-11)
  • MachineTokenType (20-20)
packages/backend/src/tokens/types.ts (2)
  • AuthenticateRequestOptions (19-70)
  • MachineAuthObject (181-183)
packages/backend/src/tokens/machine.ts (1)
  • isMachineTokenByPrefix (21-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
packages/nextjs/src/server/data/getAuthDataFromRequest.ts (5)

1-32: Import structure and type definitions look good.

The new imports for MachineAuthObject and MachineTokenType align with the refactored authentication flow, and the GetAuthDataFromRequestOptions type properly extends the required options.


37-64: Well-structured helper functions improve code organization.

The getAuthHeaders and createAuthOptions functions properly extract common patterns and provide clean abstractions for header extraction and options creation with appropriate fallbacks.


70-100: Session token handling is correctly implemented.

The renamed getSessionAuthDataFromRequest function properly restricts processing to session tokens only and maintains the expected synchronous behavior. This addresses the previous review concern about treatPendingAsSignedOut consistency between sync and async variants.


110-142: Main authentication function correctly implements the optimization.

The refactored getAuthDataFromRequest function successfully eliminates duplicate API calls by handling machine tokens synchronously via encrypted request data, then falling back to session token processing. The logic flow is correct and addresses the PR objectives.

However, since this involves changes to core authentication mechanisms, please tag clerk/security for review to ensure the synchronous machine token handling maintains security properties.


144-172: Verify Machine Token Handling in handleMachineToken

Please manually confirm the following security-critical behaviors in your new synchronous machine token logic:

  • Raw token exposure
    The getToken() method resolves the original bearer token directly. Ensure this does not expose the token in logs, telemetry, or downstream code paths compared to the previous async flow.

  • has() always returns false
    Confirm that denying all permission checks on machine tokens (i.e. has() => false) matches your authorization model and won’t break any callers relying on feature flags or scopes.

  • Auth object reconstruction
    You’re spreading rawAuthObject and overriding only debug(). Verify no properties or methods (e.g. error handlers, metrics hooks) are inadvertently dropped or shadowed.

Tagging clerk/security for a focused review on these items.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 321711b and 57a6875.

📒 Files selected for processing (5)
  • packages/nextjs/src/app-router/server/auth.ts (1 hunks)
  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts (1 hunks)
  • packages/nextjs/src/server/clerkMiddleware.ts (2 hunks)
  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts (3 hunks)
  • packages/nextjs/src/server/utils.ts (7 hunks)
📓 Path-based instructions (9)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
packages/**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Unit tests should use Jest or Vitest as the test runner.

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/typescript.mdc)

**/__tests__/**/*.{ts,tsx}: Create type-safe test builders/factories
Use branded types for test isolation
Implement proper mock types that match interfaces

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
**/*

⚙️ CodeRabbit Configuration File

**/*: If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

Whenever reviewing a pull request, if there are any changes that could impact security, always tag clerk/security in the PR.

Security-impacting changes include, but are not limited to:

  • Changes to authentication logic or mechanisms (e.g. login, session handling, token issuance)
  • Any modification to access control, authorization checks, or role-based permissions
  • Introduction or modification of hashing algorithms, signature verification, or cryptographic primitives
  • Handling of sensitive data (e.g. passwords, tokens, secrets, PII)
  • Integration with external identity providers (e.g. SSO, OAuth, OpenID Connect)
  • Modifications to security headers, cookie flags, CORS policies, or CSRF protections
  • Bypass mechanisms (e.g. feature flags, testing overrides) that could weaken protections
  • Changes to rate limiting, abuse prevention, or input validation

If you're unsure whether a change is security-relevant, err on the side of caution and tag clerk/security.

Any time that you tag clerk/security, please do so explicitly in a code comment, rather than within a collapsed section in a coderabbit comment, such as the "recent review details" section. If you do use the team name in any thinking or non-direct-code-comment content, it can be referred to as "clerk security team" to avoid accidentally printing the tag which sends a notification to the team.

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
🧬 Code Graph Analysis (1)
packages/nextjs/src/app-router/server/auth.ts (1)
packages/backend/src/tokens/tokenTypes.ts (2)
  • TokenType (1-6)
  • TokenType (11-11)
🪛 Biome (1.9.4)
packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts

[error] 47-47: Don't focus the test.

The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.

(lint/suspicious/noFocusedTests)

🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/nextjs/src/server/clerkMiddleware.ts
  • packages/nextjs/src/server/utils.ts
  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
packages/**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Unit tests should use Jest or Vitest as the test runner.

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/typescript.mdc)

**/__tests__/**/*.{ts,tsx}: Create type-safe test builders/factories
Use branded types for test isolation
Implement proper mock types that match interfaces

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
**/*

⚙️ CodeRabbit Configuration File

**/*: If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

Whenever reviewing a pull request, if there are any changes that could impact security, always tag clerk/security in the PR.

Security-impacting changes include, but are not limited to:

  • Changes to authentication logic or mechanisms (e.g. login, session handling, token issuance)
  • Any modification to access control, authorization checks, or role-based permissions
  • Introduction or modification of hashing algorithms, signature verification, or cryptographic primitives
  • Handling of sensitive data (e.g. passwords, tokens, secrets, PII)
  • Integration with external identity providers (e.g. SSO, OAuth, OpenID Connect)
  • Modifications to security headers, cookie flags, CORS policies, or CSRF protections
  • Bypass mechanisms (e.g. feature flags, testing overrides) that could weaken protections
  • Changes to rate limiting, abuse prevention, or input validation

If you're unsure whether a change is security-relevant, err on the side of caution and tag clerk/security.

Any time that you tag clerk/security, please do so explicitly in a code comment, rather than within a collapsed section in a coderabbit comment, such as the "recent review details" section. If you do use the team name in any thinking or non-direct-code-comment content, it can be referred to as "clerk security team" to avoid accidentally printing the tag which sends a notification to the team.

Files:

  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/app-router/server/auth.ts
🧬 Code Graph Analysis (1)
packages/nextjs/src/app-router/server/auth.ts (1)
packages/backend/src/tokens/tokenTypes.ts (2)
  • TokenType (1-6)
  • TokenType (11-11)
🪛 Biome (1.9.4)
packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts

[error] 47-47: Don't focus the test.

The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.

(lint/suspicious/noFocusedTests)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)

Comment on lines +182 to +186
if (authObject.tokenType === TokenType.SessionToken) {
return Object.assign(authObject, { redirectToSignIn, redirectToSignUp });
}

return authObject;
Copy link
Contributor

@coderabbitai coderabbitai bot Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Conditional redirect methods based on token type - approve with security review needed.

This change correctly restricts redirect methods to session tokens only, which makes semantic sense since machine tokens, API keys, and OAuth tokens are for programmatic access and don't need user redirect capabilities.

However, this modifies core authentication logic and should be reviewed by the security team.

Please tag clerk/security for review of this authentication logic change.

Also, ensure test coverage exists for both branches of this conditional logic:

If test coverage is missing, please add tests to verify:

  1. Session tokens return authObject with redirect methods
  2. Non-session tokens return authObject without redirect methods
  3. The redirect methods work correctly when present

🏁 Script executed:

#!/bin/bash
# Description: Check for test coverage of conditional redirect method behavior

# Search for tests related to auth function with different token types
rg -A 10 -B 5 "auth.*tokenType|tokenType.*auth" --type ts --type js

# Search for tests of redirect methods on auth objects
rg -A 10 -B 5 "redirectToSignIn|redirectToSignUp" --type ts --type js packages/nextjs/src/app-router/server/__tests__/ || echo "No tests directory found"

# Search for machine token or API key auth tests
rg -A 10 -B 5 "machine_token|api_key|MachineAuthObject" --type ts --type js packages/nextjs/src/app-router/server/__tests__/ || echo "No tests directory found"

Length of output: 76688


Conditional redirect methods for session tokens – approve with security review and add missing tests

The change correctly restricts redirectToSignIn/redirectToSignUp to SessionToken cases, aligning behavior with token semantics.
However, no unit tests currently cover this branch in packages/nextjs/src/app-router/server/auth.ts.

• Tag clerk/security for review of the updated authentication logic.
• Add a new test suite under packages/nextjs/src/app-router/server/__tests__/auth.test.ts covering:

  • When authObject.tokenType === TokenType.SessionToken, the returned object includes working redirectToSignIn and redirectToSignUp methods.
  • When authObject.tokenType !== TokenType.SessionToken, the returned object does not expose redirect methods (calls should error or be undefined).
🤖 Prompt for AI Agents
In packages/nextjs/src/app-router/server/auth.ts lines 182-186, the code
conditionally adds redirectToSignIn and redirectToSignUp methods only for
SessionToken token types. To fix, request a security review from the
clerk/security team for this authentication logic update. Then, add a new test
suite in packages/nextjs/src/app-router/server/__tests__/auth.test.ts that
verifies when tokenType is SessionToken, the returned object includes
functioning redirect methods, and when tokenType is not SessionToken, these
redirect methods are absent or cause errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wobsoriano Do types already cover this case ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@panteliselef yes, but want to make sure machine auth objects dont include redirect functions at runtime as well

Copy link
Member

@panteliselef panteliselef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good overall, I left a few comments

Comment on lines +182 to +186
if (authObject.tokenType === TokenType.SessionToken) {
return Object.assign(authObject, { redirectToSignIn, redirectToSignUp });
}

return authObject;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wobsoriano Do types already cover this case ?

Comment on lines 102 to 103
secretKey: opts?.secretKey || decryptedRequestData.secretKey || SECRET_KEY,
publishableKey: decryptedRequestData.publishableKey || PUBLISHABLE_KEY,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parts of the sync versus the async variant seem to be getting out of sync. Can we remove duplication ?

treatPendingAsSignedOut seems to be missing from the async variant, is that on purpose ?

Actually are authStatus, authMessage, authReason ever used when passed as options ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated and removed redundant logic

return getSessionAuthDataFromRequest(req, opts);
};

const handleMachineToken = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is middleware always a requirement now, or was that the case since the start ? If middleware is not a requirement, don't we still need to support on async verification ?

Copy link
Member Author

@wobsoriano wobsoriano Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good question! If I understand your question correctly, say someone excludes routes from middleware via the matcher config in the middleware, those routes won't have the encrypted x-clerk-request-data header available right? Meaning there wouldn't be an encrypted machine auth object, and we'll still need async verification...

Edit: Actually when someone excludes a path from middleware and then tries to call the auth() helper, they'll get the error auth() was called but Clerk can't detect usage of clerkMiddleware() so it looks like we're still in the right path. getAuthDataFromRequest function was always a sync until async verification was added.

@wobsoriano wobsoriano changed the title chore(nextjs): WIP Improve machine auth verification calls chore(nextjs): Improve machine auth verification calls Jul 23, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/nextjs/src/server/data/getAuthDataFromRequest.ts (1)

111-143: Address the past review comment about async support.

Based on the past review comments, there's a question about whether middleware is always required and if async verification is still needed when routes are excluded from middleware. The current implementation assumes encrypted request data is always available.

This addresses the concern raised in the past review about middleware requirements and async verification support.

🧹 Nitpick comments (1)
packages/nextjs/src/server/data/getAuthDataFromRequest.ts (1)

115-117: Potential performance concern with repeated decryption.

The decryptClerkRequestData is called in both createAuthOptions (line 53) and getAuthDataFromRequest (line 116), which could lead to redundant decryption operations.

Consider caching the decrypted data to avoid duplicate decryption:

 export const getAuthDataFromRequest = (req: RequestLike, opts: GetAuthDataFromRequestOptions = {}): AuthObject => {
   const { authStatus, authMessage, authReason } = getAuthHeaders(req);
   opts.logger?.debug('headers', { authStatus, authMessage, authReason });

+  const encryptedRequestData = getHeader(req, constants.Headers.ClerkRequestData);
+  const decryptedRequestData = decryptClerkRequestData(encryptedRequestData);
+
-  const encryptedRequestData = getHeader(req, constants.Headers.ClerkRequestData);
-  const decryptedRequestData = decryptClerkRequestData(encryptedRequestData);

   const bearerToken = getHeader(req, constants.Headers.Authorization)?.replace('Bearer ', '');
   const acceptsToken = opts.acceptsToken || TokenType.SessionToken;

-  const options = createAuthOptions(req, opts);
+  const options = createAuthOptionsWithDecryptedData(req, opts, decryptedRequestData);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 176182b and 83e00ed.

📒 Files selected for processing (3)
  • packages/nextjs/src/server/__tests__/getAuthDataFromRequest.test.ts (3 hunks)
  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts (4 hunks)
  • packages/nextjs/src/server/utils.ts (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/nextjs/src/server/tests/getAuthDataFromRequest.test.ts
  • packages/nextjs/src/server/utils.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
**/*

⚙️ CodeRabbit Configuration File

**/*: If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

Whenever reviewing a pull request, if there are any changes that could impact security, always tag clerk/security in the PR.

Security-impacting changes include, but are not limited to:

  • Changes to authentication logic or mechanisms (e.g. login, session handling, token issuance)
  • Any modification to access control, authorization checks, or role-based permissions
  • Introduction or modification of hashing algorithms, signature verification, or cryptographic primitives
  • Handling of sensitive data (e.g. passwords, tokens, secrets, PII)
  • Integration with external identity providers (e.g. SSO, OAuth, OpenID Connect)
  • Modifications to security headers, cookie flags, CORS policies, or CSRF protections
  • Bypass mechanisms (e.g. feature flags, testing overrides) that could weaken protections
  • Changes to rate limiting, abuse prevention, or input validation

If you're unsure whether a change is security-relevant, err on the side of caution and tag clerk/security.

Any time that you tag clerk/security, please do so explicitly in a code comment, rather than within a collapsed section in a coderabbit comment, such as the "recent review details" section. If you do use the team name in any thinking or non-direct-code-comment content, it can be referred to as "clerk security team" to avoid accidentally printing the tag which sends a notification to the team.

Files:

  • packages/nextjs/src/server/data/getAuthDataFromRequest.ts
🧬 Code Graph Analysis (1)
packages/nextjs/src/server/data/getAuthDataFromRequest.ts (8)
packages/nextjs/src/server/types.ts (1)
  • RequestLike (9-9)
packages/nextjs/src/server/headers-utils.ts (2)
  • getAuthKeyFromRequest (11-16)
  • getHeader (18-27)
packages/backend/src/internal.ts (8)
  • constants (1-1)
  • SignedInAuthObject (23-23)
  • SignedOutAuthObject (24-24)
  • TokenType (18-18)
  • AuthenticateRequestOptions (11-11)
  • MachineTokenType (19-19)
  • isMachineTokenByPrefix (57-57)
  • getAuthObjectForAcceptedToken (36-36)
packages/nextjs/src/server/utils.ts (1)
  • decryptClerkRequestData (225-254)
packages/nextjs/src/server/constants.ts (4)
  • SECRET_KEY (7-7)
  • PUBLISHABLE_KEY (8-8)
  • API_URL (10-10)
  • API_VERSION (6-6)
packages/backend/src/tokens/authObjects.ts (4)
  • SignedInAuthObject (44-62)
  • SignedOutAuthObject (67-83)
  • AuthObject (162-167)
  • getAuthObjectForAcceptedToken (465-495)
packages/backend/src/tokens/types.ts (2)
  • AuthenticateRequestOptions (19-70)
  • MachineAuthObject (181-183)
packages/backend/src/tokens/machine.ts (1)
  • isMachineTokenByPrefix (21-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
packages/nextjs/src/server/data/getAuthDataFromRequest.ts (6)

1-7: LGTM: Clean import organization and proper type imports.

The imports are well-organized with proper separation of type imports and the addition of MachineAuthObject type import aligns with the new machine token handling functionality.


38-46: Good extraction of auth header logic into a helper function.

This refactoring improves code reusability and makes the auth header extraction more explicit and testable.


71-101: Approve the session-specific authentication function.

The function correctly handles session token authentication with proper validation and error handling. The explicit comment about machine tokens not being supported provides good clarity.


51-65: Ignore incorrect assertion about removed auth fields

The snippet in packages/nextjs/src/server/data/getAuthDataFromRequest.ts (lines 51–65) already returns authStatus, authMessage, and authReason as shown. There is no removal of these properties and no further action is needed.

Likely an incorrect or invalid review comment.


145-173: handleMachineToken implementation is correct as-is

The existing type assertion is required to satisfy TypeScript’s union-based return type (AuthObject vs. MachineAuthObject). At runtime we know getAuthObjectForAcceptedToken returns a valid machine auth object in this branch, so the as MachineAuthObject<MachineTokenType> cast is safe. The acceptsOnlySessionToken check correctly guards against session-only scenarios, and prefix-based token detection along with pre-validated rawAuthObject ensures proper validation. No changes are necessary here.


111-143: Authentication flow verified as secure

  • decryptClerkRequestData returns an empty object only when the header is absent and will throw on malformed or invalid payloads
  • Machine tokens are intentionally handled first via handleMachineToken, preserving the designed hierarchy
  • Bearer-token extraction (getHeader(...)?​.replace('Bearer ', '')) and the subsequent validation branches are correct

No further fixes or security reviews are required.

} from '@clerk/backend/internal';
import { decodeJwt } from '@clerk/backend/jwt';
import type { PendingSessionOptions } from '@clerk/types';
import type { AuthenticateContext } from 'node_modules/@clerk/backend/dist/tokens/authenticateContext';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use relative import path instead of node_modules reference.

The import is referencing the node_modules directory directly, which is brittle and non-standard.

-import type { AuthenticateContext } from 'node_modules/@clerk/backend/dist/tokens/authenticateContext';
+import type { AuthenticateContext } from '@clerk/backend/internal';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { AuthenticateContext } from 'node_modules/@clerk/backend/dist/tokens/authenticateContext';
// packages/nextjs/src/server/data/getAuthDataFromRequest.ts
-import type { AuthenticateContext } from 'node_modules/@clerk/backend/dist/tokens/authenticateContext';
+import type { AuthenticateContext } from '@clerk/backend/internal';
🤖 Prompt for AI Agents
In packages/nextjs/src/server/data/getAuthDataFromRequest.ts at line 21, the
import statement uses a direct node_modules path which is non-standard and
brittle. Change the import to use a relative or package-based path by removing
'node_modules/' and importing directly from
'@clerk/backend/dist/tokens/authenticateContext' to follow standard module
resolution practices.

@wobsoriano wobsoriano enabled auto-merge (squash) July 23, 2025 19:38
@wobsoriano wobsoriano merged commit b9f32e0 into main Jul 23, 2025
38 checks passed
@wobsoriano wobsoriano deleted the rob/user-2379-auth-improvement branch July 23, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants